<table>
	<tr>
    	<th>ID</th>
        <th>Name</th>
        <th>Title</th>
        <th>Content</th>
        <th>Mark</th>
        <th>Create Date</th>  
        <th>Edit / Del</th>        
    </tr><?php if(count($data)>0){
			foreach($data as $list){ ?>
				<tr>
                    <th><?php echo $list['id'] ?></th>
                    <td><?php echo $list['name'] ?></td>
                    <td><?php echo $list['title'] ?></td>
                    <td><?php echo $list['contents'] ?></td>
                    <th><?php echo $list['mark'] ?></th>
                    <td><?php echo date('d/m/Y',strtotime($list['createdate'])); ?></td>  
                    <th><a href="javascript:void(0);" onclick="location.assign('<?php echo base_url(); ?>admin/destinationreview/index?id=<?php echo $list['id'] ?>');"><img src="<?php echo base_url(); ?>public/admin/img/icons/user_edit.png"/></a><a href="javascript:void(0);" onClick="if(confirm('Do you want to Del this destination review is information ?')) location.assign('<?php echo base_url(); ?>admin/destinationreview/delete?id=<?php echo $list["id"]; ?>');"><img src="<?php echo base_url(); ?>public/admin/img/icons/user_delete.png"/></a></th>            
                </tr>
			<?php }
		}?>
</table>

<div id="box">
<form action="<?php echo base_url(); ?>admin/destinationreview/<?php if(isset($_GET["id"])) echo "update?id=".intval($_GET["id"]);else echo "insert";?>" method="post">
	<fieldset  id="personal">
    	<legend>&nbsp;&nbsp;Edit Destination Review&nbsp;&nbsp;</legend>
        <label>ID : </label>ID<br>
		<label>Name : </label><input type="text" required value="<?php echo $detail["name"] ?>" name="name"/><br>
		<label>Title : </label><input type="text" required value="<?php echo $detail["title"] ?>" name="title"/><br>
        <label>Content : </label><textarea name="contents"><?php echo $detail["contents"] ?></textarea><br>
        <label>Mark : </label><input type="text" required value="<?php echo $detail["mark"] ?>" name="mark"/><br>
        <label>Create Date : </label><input type="text" id="datepicker" name="createdate" required value="<?php echo date('Y/m/d H:s:i',strtotime($detail["createdate"])); ?>"/><br>
        <label>destination ID : </label><select name="destinationid"><option value="-1">Choice destination ID</option>
        	<?php foreach($destination as $listdestinationid){?>
				<option value="<?php echo $listdestinationid['id'] ?>" <?php if($detail["destinationid"]==$listdestinationid['id']) echo "selected";?>><?php echo $listdestinationid['id']." - ".$listdestinationid['name'] ?></option>	
			<?php }?>
        </select><br>
<div style="float:left;padding-top:5px;padding-left:40%;"><input type="reset" value="Reset">&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="Submit"></div>
    </fieldset>
    
</form>
</div>